package com.base.threadpool.task.factory;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.TimerTask;

/**
 * 异步工厂（产生任务用）
 * 调用方法
 * AsyncManager.me().execute(AsyncFactory.recordLogininfor(userName, Constants.LOGOUT, "退出成功"));
 * @author ruoyi
 */
public class AsyncFactory
{
    private static final Logger logger = LoggerFactory.getLogger("common_logger");

    /**
     *
     * @return 任务task
     */
    public static <T> TimerTask task(T taskParams, String flag) throws Exception {
        return TaskFactoryBuilder.getInstance().getTaskFactory(taskParams, flag);
    }

}
